<%#
  # WebROaR - Ruby Application Server - http://webroar.in/
  # Copyright (C) 2009  Goonj LLC
  #
  # This file is part of WebROaR.
  #
  # WebROaR is free software: you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation, either version 3 of the License, or
  # (at your option) any later version.
  #
  # WebROaR is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public License
  # along with WebROaR.  If not, see <http://www.gnu.org/licenses/>.
  #%>

  <%= form_for :sendmail, :html => { :onsubmit => 'return validate_sendmail(this)'}, :url => {:controller => 'mail_specification', :action => 'save_sendmail_settings'} do%>
    <table width = '95%' align='center'>
      <tr>
        <th width = 50%><b>Mail Settings</b>&nbsp;&nbsp;&nbsp;
            <%=link_to_function('Help', :onclick => 'addHelp("mail",event);')%>
        </th>
        <th  width = 50%><%=link_to_remote 'SMTP', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'smtp_form'}%></th>
      </tr>
      <tr>
        <td colspan = 2 id = 'error_div_sendmail_form' style="padding:0px;"><%if flash[:sendmail_errors]%><%=flash[:sendmail_errors]%><%end%></td>
      </tr>  
      <tr>
        <td>Sendmail Location<span id = 'needed'>*</span> &nbsp;&nbsp;&nbsp;
            <%=link_to_function('Help', :onclick => 'addHelp("sendmail_location",event);')%>
        </td>
        <td ><%=text_field :sendmail, :location, :size => 40, :value => @sendmail_old[:location]%></td>
      </tr>
      <tr>
        <td>Sender's Email Address<span id = 'needed'>*</span> &nbsp;&nbsp;&nbsp;</td>
        <td><%=text_field :sendmail, :from, :size => 40, :value => @sendmail_old[:from]%></td>
      </tr>
      <tr>  
        <td>Recipient Email Addresses<span id = 'needed'>*</span> &nbsp;&nbsp;&nbsp;
           <%=link_to_function('Help', :onclick => 'addHelp("sendmail_recipients_id",event);')%>
        </td>
        <td><%=text_field :sendmail, :recipients, :size => 40, :value => @sendmail_old[:recipients]%></td>
      </tr>
      <tr>
        <td colspan = 2 style="text-align:center;"><%=submit_tag 'Save'%>&nbsp;&nbsp;&nbsp;&nbsp;<%=button_to_function 'Cancel', 'window.location.reload();'%></td>
      </tr>
    </table>
  <%end%>
  <br><br>
